import request from "@/utils/request";
export const articles = (params)=> request({
  url:'/v1_0/articles',
  params
})

export const getArticles = (id)=> request({
  url:'/v1_0/articles/'+ id
})
// 收藏文章
export const collections = (id)=> request({
  method:'POST',
  url:'/v1_0/article/collections',
  data:{
    target:id
  }
})
// 取消收藏
export const  cancel = (id)=> request({
  method:'DELETE',
  url:`/v1_0/article/collections/${id}`
})
// 文章点赞
export const addlike = (id)=>request({
  method:"POST",
  url:'/v1_0/article/likings',
  data:{
    target:id
  }
})
// 取消点赞
export const removlike = (id)=> request({
  method:'DELETE',
  url:`/v1_0/article/likings/${id}`
})

